-
Notifications
You must be signed in to change notification settings - Fork 2.2k
backport:allow misson control manager to startup despite errors #10402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
backport:allow misson control manager to startup despite errors #10402
Conversation
Summary of ChangesHello @ziggie1984, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the robustness of the LND Mission Control Manager by implementing a mechanism to gracefully handle and recover from corrupted data within its persistent store. Previously, deserialization errors could prevent the manager from starting; now, such problematic entries are identified, logged, and automatically removed, ensuring continuous operation and improving overall system stability. Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request improves the robustness of the mission control manager during startup by handling deserialization errors gracefully. Instead of failing, corrupted entries are now skipped and deleted from the store, preventing startup failures. The changes in routing/missioncontrol_store.go are well-implemented and include a comprehensive test case. I've added a couple of comments: one for a minor typo in the release notes and another suggesting a performance improvement in fetchAll.
46299f4 to
bec8327
Compare
routing/missioncontrol_store.go
Outdated
|
|
||
| // Delete corrupted entries from the database. | ||
| for _, key := range corruptedKeys { | ||
| if err := resultBucket.Delete(key); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's do this in another pass in a diff txn? That way the happy case it only needs a read transaction.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
We now allow the mission control manager to skip over deserializable errors. We cannot repair this these results but we just skip over it so we can startup properly. When fetchAll() encounters entries that fail to deserialize, in addition to skipping them, now also: - Delete the corrupted entries from the database - Remove them from the in-memory keysMap and keys tracking structures This prevents corrupted entries from: - Being counted toward maxRecords, which would cause valid entries to be pruned prematurely - Persisting in the database indefinitely - Causing inaccurate entry counts in startup logs
bec8327 to
1fa6f70
Compare
Roasbeef
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🍬
b60920b
into
lightningnetwork:v0.20.x-branch
backports #10383